<!DOCTYPE html>
<html lang="en"><html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>发布文章</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/css/communtiy.css">
    <link rel="stylesheet" href="/css/editormd.min.css">

    <script src="https://www.jq22.com/jquery/jquery-3.3.1.js"></script>
    <script src="/js/bootstrap.min.js" type="application/javascript"></script>
    <script src="/js/communtiiys.js" type="application/javascript"></script>
    <script src="/js/editormd.min.js" type="application/javascript"></script>

</head>
<body style="background-color: #efefef;">
<div th:insert="~{navaigation::nav}"></div>
<!--//问题首页-->
<div class="container-fluid ">
    <div class="row " style="margin: 30px;">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2><span class="glyphicon glyphicon-plus" aria-hidden="true"></span>发起</h2>
            <hr>
            <form action="/publish" method="post">
                <!--携带文章的id用于更新-->
                <input type="hidden" name="quesionId" th:value="${quesionId}">
                <div class="form-group">
                    <label for="title">问题标题</label>
                    <input type="text"  th:value="${title}" class="form-control" id="title" name="title" placeholder="问题标题">
                </div>
                <!--富文本编辑-->
                <div class="form-group" id="qusion_editos">
                    <label for="title">问题补充（必填）</label>
                    <textarea style="display: none" th:text="${description}" name="description" class="form-control" id="description" cols="30"rows="10"></textarea>
                </div>
                <script type="application/javascript">
                    $(function () {
                        var editor=editormd("qusion_editos",{
                            width:"100%",
                            height:450,
                            path:"/js/lib/",
                            delay:0,
                            watch:false,  //默认不让预览
                            placeholder:'输入问题描述,比如java代码，只需要```java  (你的内容) ````',
                            imageUpload    : true,//使用图片上传
                            imageFormats   : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                            imageUploadURL : "/file/upload",
                        });
                    });
                </script>


                <div class="form-group">
                    <label for="title">添加标签</label>
                    <input onclick="showttSelecttag()" type="text" th:value="${tag}" class="form-control"
                           id="tag" name="tag" readonly="readonly" placeholder="问题标签以逗号隔开">
                </div>



                <!--标签库,默认不展示-->
                <div id="select_tag">
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">开发语言</a></li>
                        <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">平台架构</a></li>
                        <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">工具</a></li>
                        <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">服务器</a></li>
                    </ul>

                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane active" id="home" >
                            <span class="label label-info quesion-tags " th:each="progrm:${progrmList}">
                                 <span class="glyphicon glyphicon-tag select_tag"  onclick="selectTags(this)" th:data-tags="${progrm}" th:text="${progrm}"></span>
<!--                                <span class="glyphicon glyphicon-minus" aria-hidden="true"></span>-->
                            </span>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="profile">
                              <span class="label label-info quesion-tags " th:each="progrm:${frameworkList}">
                                 <span class="glyphicon glyphicon-tag select_tag"  onclick="selectTags(this)" th:data-tags="${progrm}" th:text="${progrm}"></span>
                            </span>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="messages">
                              <span class="label label-info quesion-tags " th:each="progrm:${toolList}">
                                 <span class="glyphicon glyphicon-tag select_tag"  onclick="selectTags(this)" th:data-tags="${progrm}" th:text="${progrm}"></span>
                            </span>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="settings">
                              <span class="label label-info quesion-tags " th:each="progrm:${servetList}">
                                 <span class="glyphicon glyphicon-tag select_tag"  onclick="selectTags(this)" th:data-tags="${progrm}" th:text="${progrm}"></span>
                            </span>
                        </div>
                    </div>

                </div>
                <div class="container-fluid">
                    <div class="row">
                        <div style="margin-top: 30px;" th:text="${errors}" th:if="${errors!=null}" class="alert alert-danger col-lg-9 col-md-12 col-sm-12 col-xs-12">

                        </div>
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <button type="submit" class="btn btn-success btn-publish" style="float:right">发布问题</button>
                        </div>
                    </div>
                </div>



            </form>
        </div>

        <div class="col-lg-3 col-md-12 col-sm-12 col-sm-12 col-xs-12">
           <h2> 问题发起指南</h2>
            • 问题标题: 请用精简的语言描述您发布的问题，不超过25字<br>
            • 问题补充: 详细补充您的问题内容，并确保问题描述清晰直观, 并提供一些相关的资料<br>
            • 选择标签: 选择一个或者多个合适的标签，用逗号隔开，每个标签不超过10个字<br>
        </div>
    </div>
</div>
</body>

</html>